<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<title>关联事件列表</title>
<%@ include file="/commons/commonList.jsp"%>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/common.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/div/common.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/ajaxException.js"></script>

<script type="text/javascript">
	var associatedEventID = null;
	function openNewLink(){ //新建事件关联
  		var url = "${ctx}/customerService_custServEventAction.do?method=initCustomerEventSearchMain&keyword=${keyword}";
	 	top.windowOpen(url, "custEventSearch", "搜索客服事件", 510, 1000,true,"custEventSearchFrame");
	}

	function openRiddanceCSEvent(){ //确认事件关联
		if(associatedEventID == null){
			Alert("请选择要解除关联的记录");
		}
		AskConfirm("您确认要解除关联吗?","linkTheOtherFrame","riddanceCSEvent");
	}
	function riddanceCSEvent(){ //解除事件关联
		var url = "${ctx}/customerService_custServEventAction.do?method=riddanceCSEvent";
		var param = "&eventId=${keyword}&associatedEventID=" + associatedEventID;

		sendAjaxRequest(url,param,function(result){
			var resultStr = result.responseText;
			ajaxSubmitException(resultStr);
			flushFrame();
		});
	}

	function flushFrame(){
		var url = "${ctx}/customerService_custServEventAction.do?method=initLinkTheOtherListMain&keyword=${keyword}";
	  	document.location.href = url;
	}
	function flushMainFrame(){//刷新主页面
		findFrame("main").refleshFrame();
	}
</script>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>
        	<span class="window_head_intext">
        		<img src="${ctx}/images/ico_Advance.gif" align="absmiddle" />&nbsp;关联事件列表
        	</span>
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td valign="middle" class="content">

	<table width="100%" border="0" cellpadding="0" cellspacing="1">
          <tr>
            <td>

<div>
  <table width="100%" border="0" cellpadding="0" cellspacing="0"   class="tab_line">
    <tr>
      <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
          <td align="right"><!--------------------------右边图标01----------------------------------->
                <table border="0" cellpadding="0" cellspacing="0" id="ico1">
                  <pms:AuthTag authName="customerService_custServEventAction.do?method=associateCSEvent">
                  <td class="toolbarico">
                  	<a href="#" onClick="openNewLink();"onfocus="this.blur()">
                  		<img src="${ctx}/images/ico_yhhk_gh.gif" alt="新建关联" width="16" height="16" border="0" align="absbottom"/>&nbsp;新建关联
                  	</a>
                  </td>
                  </pms:AuthTag>
                   <td class="toolbarico">&nbsp;</td>
                  </tr>
                </table>
            <!--------------------------右边图标end----------------------------------->          </td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td valign="top">
<div style="overflow:auto; height:300px;">
  <ec:ceTable items="customerEventList"
	action="${ctx}/customerService_custServEventAction.do?method=initLinkTheOtherListMain&keyword=${keyword}"
	var="customerEvent"
	view="pmsview"
	styleClass="gridData2"
	rowsDisplayed="10" >
	<ec:ceRow styleClass="grid"
		onclick="associatedEventID=${customerEvent.keyword};"
		ondblclick=""
		onContextMenu="return ShowContextMenu(event,'quick_rightmenu');">
		<ec:ceColumn headerCell="pmsHeadrCell" title="事件编号" property="eventNo" sortable="false" width="14%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="详细地点" property="fullAddress" sortable="false" width="7%"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="房 号" property="houseNumber" sortable="false" width="6%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="联系人" property="contact" sortable="false" width="8%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="紧急程度" property="emergencyDegreeName" sortable="false" width="8%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="事件性质" property="custServEventNatureName" sortable="false" width="8%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="事件内容" property="eventContent" sortable="false" width="15%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="有效性" property="validityStr" sortable="false" width="6%">
			<c:choose>
				<c:when test="${customerEvent.validityStr eq '001'}">有效</c:when>
				<c:when test="${customerEvent.validityStr eq '000'}">无效</c:when>
				<c:when test="${customerEvent.validityStr eq '002'}">待定</c:when>
			</c:choose>
		</ec:ceColumn>
		<ec:ceColumn headerCell="pmsHeadrCell" title="事件状态" property="eventStatuzStr" sortable="false" width="7%" >
			<c:choose>
				<c:when test="${customerEvent.eventStatuzStr eq '001'}">新 建</c:when>
				<c:when test="${customerEvent.eventStatuzStr eq '002'}">已提交</c:when>
				<c:when test="${customerEvent.eventStatuzStr eq '003'}">已完工</c:when>
				<c:when test="${customerEvent.eventStatuzStr eq '004'}">待归档</c:when>
				<c:when test="${customerEvent.eventStatuzStr eq '005'}">已归档</c:when>
				<c:when test="${customerEvent.eventStatuzStr eq '000'}">作 废</c:when>
			</c:choose>
		</ec:ceColumn>
	</ec:ceRow>
</ec:ceTable>
</div>
      </td>
    </tr>
  </table>
</div></td>
            </tr>
        </table>




	</td>
  </tr>
  <tr>
    <td colspan="2" class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
          <td class="btn_between_space"></td>
          <td>
          </td>
          <td class="btn_between_space"></td>
          <td><table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="buttonOffLeft" id="btn1_31"></td>
                <td class="buttonOffMiddle" id="btn1_32"
                	onClick="flushMainFrame();windowClose();"
                	onMouseOver="btn_change_over(3)"
                	onMouseOut="btn_change_out(3)"
                	onBlur="btn_change(3)">
                	<img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 关 闭

                </td>
                <td class="buttonOffRight" id="btn1_33"></td>
              </tr>
          </table></td>
        </tr>
          </table>
      <p>&nbsp;</p></td>
  </tr>
</table>

<!--------------------右键1---------------------->
<div id="quick_rightmenu" style="display:none;" oncontextmenu="return false" class="quick_rightmenu">
  <table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg">
    <tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
        <pms:AuthTag authName="customerService_custServEventAction.do?method=riddanceCSEvent">
        <tr>
         <td class="quickMenu_toolbarico">
	         <a href="#"  onClick="openRiddanceCSEvent();"onFocus="this.blur()">
	         	<img src="${ctx}/images/ico_sfyj_fanjiezhang.gif" border="0" align="absbottom" alt="解除关联"/>&nbsp;解除关联
	         </a>
         </td>
        </tr>
        </pms:AuthTag>

  </table>
  </td>
          </tr>
  </table>
<script type="text/javascript">

	var div1=document.getElementById('quick_rightmenu');
	if(div1.getElementsByTagName("tr").length==1){
	div1.innerHTML="";
	}
</script>
</div>
<!---右键1完-->



</body>
</html>